package com.elecbook.rpc.feignclient.fallback;

import com.elecbook.rpc.feignclient.SystemServiceClient;
import com.elecbook.system.model.dto.PropertiesDTO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class SystemServiceClientFallbackFactory implements FallbackFactory<SystemServiceClient> {
    @Override
    public SystemServiceClient create(Throwable throwable) {
        return new SystemServiceClient() {
            @Override
            public String getValue(PropertiesDTO dto) {
                log.error("查看系统信息时刻发生了错误");
                return null;
            }
        };
    }
}